<IfModule mod_security2.c>
    # ModSecurity Core Rules Set configuration
	Include modsecurity.d/*.conf
	Include modsecurity.d/activated_rules/*.conf

    # Default recommended configuration
    SecRuleEngine <%= @secruleengine %>
    SecRequestBodyAccess On
    SecRule REQUEST_HEADERS:Content-Type "text/xml" \
         "id:'200000',phase:1,t:none,t:lowercase,pass,nolog,ctl:requestBodyProcessor=XML"
    SecRequestBodyLimit <%= @request_body_limit %>
    SecRequestBodyNoFilesLimit <%= @request_body_nofileslimit %>
    SecRequestBodyInMemoryLimit <%= @request_body_inmemorylimit %>
    SecRequestBodyLimitAction <%= @request_body_limitaction %>
    SecRule REQBODY_ERROR "!@eq 0" \
    "id:'200001', phase:2,t:none,log,deny,status:400,msg:'Failed to parse request body.',logdata:'%{reqbody_error_msg}',severity:2"
    SecRule MULTIPART_STRICT_ERROR "!@eq 0" \
    "id:'200002',phase:2,t:none,log,deny,status:44,msg:'Multipart request body \
    failed strict validation: \
    PE %{REQBODY_PROCESSOR_ERROR}, \
    BQ %{MULTIPART_BOUNDARY_QUOTED}, \
    BW %{MULTIPART_BOUNDARY_WHITESPACE}, \
    DB %{MULTIPART_DATA_BEFORE}, \
    DA %{MULTIPART_DATA_AFTER}, \
    HF %{MULTIPART_HEADER_FOLDING}, \
    LF %{MULTIPART_LF_LINE}, \
    SM %{MULTIPART_MISSING_SEMICOLON}, \
    IQ %{MULTIPART_INVALID_QUOTING}, \
    IP %{MULTIPART_INVALID_PART}, \
    IH %{MULTIPART_INVALID_HEADER_FOLDING}, \
    FL %{MULTIPART_FILE_LIMIT_EXCEEDED}'"

    SecRule MULTIPART_UNMATCHED_BOUNDARY "!@eq 0" \
    "id:'200003',phase:2,t:none,log,deny,status:44,msg:'Multipart parser detected a possible unmatched boundary.'"

    SecPcreMatchLimit <%= @pcre_match_limit %>
    SecPcreMatchLimitRecursion <%= @pcre_match_limitrecursion %>

    SecRule TX:/^MSC_/ "!@streq 0" \
            "id:'200004',phase:2,t:none,deny,msg:'ModSecurity internal error flagged: %{MATCHED_VAR_NAME}'"

    SecResponseBodyAccess <%= @response_body_access %>
    SecDebugLog <%= @debug_log %>
    SecDebugLogLevel <%= @debug_log_level %>
    SecAuditEngine <%= @audit_engine %>
    SecAuditLogRelevantStatus "<%= @audit_log_relevant_status %>"
    SecAuditLogParts <%= @audit_log_parts %>
    SecAuditLogType <%= @audit_log_type %>
    SecAuditLog <%= @audit_log %>
    SecArgumentSeparator <%= @argument_separator %>
    SecCookieFormat <%= @cookie_format %>
    SecTmpDir  <%= @tmp_dir %>
    SecDataDir <%= @data_dir %>
</IfModule>
